# 作者：SP
# 开发时间：2023/3/18 14:22
import logging
my_log=logging.getLogger()
my_handler=logging.FileHandler(filename='2.txt',encoding='UTF-8')
my_handler.setLevel(logging.INFO)
my_formater=logging.Formatter('%(asctime)s-%(name)s-%(levelname)s-%(message)s')
my_handler.setFormatter(my_formater)
my_log.addHandler(my_handler)
if __name__=='__main__':
    my_log.debug('1')
    my_log.info('2')
    my_log.warning('3')
    my_log.critical('4')
    my_log.error('5')